package com.caiwl.demo.kotlin.service

import com.caiwl.demo.kotlin.entity.Organization
import com.caiwl.demo.kotlin.repo.OrganizationRepo
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.data.domain.Example
import org.springframework.data.domain.Page
import org.springframework.data.domain.Pageable
import org.springframework.stereotype.Service

/**
 * @author caiwl
 * @date 2020/5/28 17:34
 */
@Service
class ProductService {
    @Autowired
    var organizationRepo: OrganizationRepo? = null

    fun page(organization: Organization, page: Pageable): Page<Organization> {
        return organizationRepo!!.findAll(Example.of(organization), page)
    }

}